package com.huohuzhihui.merchant.service.impl;

import java.util.List;

import com.huohuzhihui.common.annotation.DataScope;
import com.huohuzhihui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.huohuzhihui.merchant.mapper.MerActivityBrowseMapper;
import com.huohuzhihui.merchant.domain.MerActivityBrowse;
import com.huohuzhihui.merchant.service.IMerActivityBrowseService;

/**
 * 活动浏览记录Service业务层处理
 * 
 * @author huohuzhihui
 * @date 2021-04-06
 */
@Service
public class MerActivityBrowseServiceImpl implements IMerActivityBrowseService 
{
    @Autowired
    private MerActivityBrowseMapper merActivityBrowseMapper;

    /**
     * 查询活动浏览记录
     * 
     * @param id 活动浏览记录ID
     * @return 活动浏览记录
     */
    @Override
    public MerActivityBrowse selectMerActivityBrowseById(Long id)
    {
        return merActivityBrowseMapper.selectMerActivityBrowseById(id);
    }

    /**
     * 查询活动浏览记录列表
     * 
     * @param merActivityBrowse 活动浏览记录
     * @return 活动浏览记录
     */
    @Override
    @DataScope(deptAlias = "m")
    public List<MerActivityBrowse> selectMerActivityBrowseList(MerActivityBrowse merActivityBrowse)
    {
        return merActivityBrowseMapper.selectMerActivityBrowseList(merActivityBrowse);
    }

    /**
     * 新增活动浏览记录
     * 
     * @param merActivityBrowse 活动浏览记录
     * @return 结果
     */
    @Override
    public int insertMerActivityBrowse(MerActivityBrowse merActivityBrowse)
    {
        merActivityBrowse.setCreateTime(DateUtils.getNowDate());
        return merActivityBrowseMapper.insertMerActivityBrowse(merActivityBrowse);
    }

    /**
     * 修改活动浏览记录
     * 
     * @param merActivityBrowse 活动浏览记录
     * @return 结果
     */
    @Override
    public int updateMerActivityBrowse(MerActivityBrowse merActivityBrowse)
    {
        return merActivityBrowseMapper.updateMerActivityBrowse(merActivityBrowse);
    }

    /**
     * 批量删除活动浏览记录
     * 
     * @param ids 需要删除的活动浏览记录ID
     * @return 结果
     */
    @Override
    public int deleteMerActivityBrowseByIds(Long[] ids)
    {
        return merActivityBrowseMapper.deleteMerActivityBrowseByIds(ids);
    }

    /**
     * 删除活动浏览记录信息
     * 
     * @param id 活动浏览记录ID
     * @return 结果
     */
    @Override
    public int deleteMerActivityBrowseById(Long id)
    {
        return merActivityBrowseMapper.deleteMerActivityBrowseById(id);
    }

    @Override
    public Long selectMerActivityBrowseCount(MerActivityBrowse merActivityBrowse) {
        return merActivityBrowseMapper.selectMerActivityBrowseCount(merActivityBrowse);
    }
}
